#include <iostream>
#include <ctime>
// 这个ctime头文件定义了关于时间相关的东西

int main()
{
    using namespace std;
    cout << "Enter the delay time, in second:";
    float secs;
    cin >> secs;
    // ctime将返回值的的类型定义为clock_t类型,作为返回值类型的别名
    clock_t delay = secs * CLOCKS_PER_SEC;

    cout << "starting \a\n";
    clock_t starting = clock();
    while (clock() - starting < delay)
    {
        ;
        // 程序将在不停的在此处重复
    }
    cout << "done" << endl;

    return 0;
}